#ifndef CHUNKMANAGER_H
#define CHUNKMANAGER_H
#include "includes.h"
#include "chunk.h"

class ChunkManager
{
    Chunk carr[MAX_CHUNKS];
    static const int max_x=X_CHUNKS*CHUNK_SIZE,
              max_y=Y_CHUNKS*CHUNK_SIZE,
              max_z=Z_CHUNKS*CHUNK_SIZE,
              size=MAX_CHUNKS;
    inline int vector_to_index(int x, int y, int z) const;
    void removeHiddenFaces(int x, int y, int z,voxel &v);
    void restoreHiddenFaces(int x, int y, int z);
public:
    ChunkManager();
    voxel& getVoxel(int x, int y, int z);
    void addVoxel(int x, int y, int z, voxel& v);
    void removeVoxel(int x, int y, int z);
    void setVoxelColor(int x, int y, int z, colour& c);
    Chunk& getChunkFromPt(int x, int y, int z);
    Chunk& operator[](int index);
    bool isValid(int x, int y, int z);
    int Size();
};

#endif // CHUNKMANAGER_H
